package com.anis.project.medcare.command.handler;

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.commands.IHandlerListener;
import org.eclipse.swt.widgets.Shell;

import com.anis.project.medcare.Activator;
import com.anis.project.medcare.search.dialog.SearchPatientDialog;

public class EditPatient implements IHandler {

	@Override
	public void addHandlerListener(IHandlerListener handlerListener) {
		// TODO Auto-generated method stub

	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub

	}

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		Shell parentShell = Activator.getDefault().getWorkbench()
				.getActiveWorkbenchWindow().getShell();
		SearchPatientDialog searchDialog = new SearchPatientDialog(parentShell);
		searchDialog.open();
		return null;
	}

	@Override
	public boolean isEnabled() {
		return Activator.getDefault().isConnectiontoDB();
	}

	@Override
	public boolean isHandled() {
		return true;
	}

	@Override
	public void removeHandlerListener(IHandlerListener handlerListener) {
		// TODO Auto-generated method stub

	}

}
